package com.yy.utils;

import org.tio.utils.json.Json;
import org.tio.websocket.common.WsResponse;

import com.yy.model.SocketMsg;
/**
 * 处理Socket消息工具类
 */
public class SocketMsgUtils {
	 /**
     * 快速生成WsResponse
     * @param action
     * @param body
     * @return
     */
    public static WsResponse madeWsResponse(byte action, Object body){
        return WsResponse.fromText(Json.toJson(new SocketMsg(action,body)),"utf-8");
    }
}
